// pages/list/list.js
const fetch=require('../../utils/fetch.js')
Page({
  data:{
    loading:false,
    activeIndex:0,
    toView:'a0'
  },
  selectMenu:function(e){
    let index=e.currentTarget.dataset.index
    console.log(index)
    this.setData({activeIndex:index,toView:'a'+index})
  },
  onLoad:function(options){
    wx.showLoading({
      title: '努力加载中',
    })
    fetch('food/list').then(res=>{
      wx.hideLoading()
      this.setData({listData:res.data,loading:true})
    })
  }
})